﻿using System;
using RatingAuthor;

namespace ConditionTreeTestStand
{
  public static class OperandTypeExtensions
  {
    public static OperandType ToOperandType(this Type type)
    {
      if (type == typeof(int)) return OperandType.Int;
      if (type == typeof(bool)) return OperandType.Bool;
      if (type == typeof(string)) return OperandType.String;
      if (type == typeof(double)) return OperandType.Float;
      if (type == typeof(GenresSet)) return OperandType.Enum;
      throw new NotSupportedException();
    }
  }
}